package org.dragon.mappers;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import org.dragon.models.Account;
import org.dragon.models.Role;

import java.util.List;

@Mapper
public interface AccountExtendMapper extends AccountMapper {

    @Select("select * from account where email = #{email} limit 1")
    @Results({
            @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
            @Result(column="nick", property="nick", jdbcType=JdbcType.VARCHAR),
            @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
            @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    Account findByEmail(@Param("email") String email);
}